package Top200;

/**
 * @author zhangmin
 * @create 2022-02-19 10:20
 * 双指针
 */
public class removeDuplicates26 {
    public int removeDuplicates(int[] nums) {
        int left=0,right=1;
        while (right< nums.length){
            if (nums[right]>nums[left]){
                nums[++left]=nums[right];
                right++;
            }else {
                right++;
            }
        }
        return left+1;
    }
}
